<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>蜗牛短视频分享平台</title>
    <link rel="stylesheet" th:href="@{/css/index.css}" />
    <script type="application/javascript" th:src="@{/js/jquery-3.5.1.js}"></script>
    <script>
        $(document).ready(function () {
            $("#favor").click(function(){
               var id= $("#id").val()
                //2，发送请求到Controller
                $.getJSON("/favor/add/"+id,function(date){
                    if (date.code==0){
                        alert(date.message);
                    } else if (date.code==1004) {
                        alert(date.message);

                    } else {
                        window.location.href="/toLogin"
                    }

                })
            });
        })
    </script>
</head>
<body>
<div
        class="v3-app-layout layoutstatus-header--Normal layoutstatus-side--Hidden limitWidth header-theme--Dark">
    <div th:replace="header :: #header"></div>
    <input id="id" th:value="${video.id}"/>
    <div class="v3-app-layout__content">
        <div class="teleplayPage__wrapper">
            <div class="teleplayPage teleplayPage--theater">
                <div class="teleplayPage__main">
                    <div class="teleplayPage__playerSection">
                        <div class="teleplayPage__playerSection__left">
                            <div class="teleplay__playerContainer__wrapper">
                                <div class="xgplayerContainer teleplay__playerContainer">
                                    <video th:src="${video.url}" controls="controls" width="100%" height="100%"></video></div>
                            </div>
                            <div class="teleplayPage__interactionZone">
                                <div class="teleplayPage__interactionZone__LeftActions">
                                    <div class="action-collect">
                                        <i class="action-collect__lottie"></i><span
                                          id="favor"  class="action-collect__txt">收藏</span>
                                    </div>
                                    <span
                                            class="video_action_item action video_action_item--tirggerAnywhere"><i
                                            class="icon-share2"></i><span>分享</span></span>
                                </div>
                            </div>
                        </div>
                        <div class="teleplayPage__playerSection__right fold"></div>
                    </div>
                </div>
            </div>
            <div class="xiguaBuddyPub xiguaBuddyPub__Lvideo"
                 data-album-id="6862666133141455367"
                 data-episode-id="6862904232702378503"></div>
        </div>
    </div>
</div>

</body>
</html>